<template>
    <div class="services">
        <div class="services-list">
            <!-- <div class="services-item" @click="onlineVisible = true">
                <img src="../assets/icons/zixun.png" alt="">
                <span>课程咨询</span>
            </div> -->
            <a-popover placement="left">
                <template #content>
                    <div class="phoneitem"> 
                        <img src="../assets/icons/phone.png" alt="">
                        <div class="lxfs">
                            <span style="color: #000000;">热线电话</span>
                            <span style="color: #3F87F9;">{{ servicesObj.service_phone }}</span>
                        </div>
                    </div>
                    <div class="phoneitem"> 
                        <img src="../assets/icons/email.png" alt="">
                        <div class="lxfs">
                            <span style="color: #000000;">服务邮箱：</span>
                            <span style="color: #3F87F9;">{{ servicesObj.service_email }}</span>
                        </div>
                    </div>
                </template>
                <div class="services-item">
                    <img src="../assets/icons/dianhua.png" alt="">
                    <span>电话咨询</span>
                </div>
            </a-popover>
             <a-popover placement="left">
                <template #content>
                    <div class="wechatWrap">
                        <img :src="servicesObj.min_qrcode" alt="">
                        <p>平台小程序码</p>
                    </div>
                </template>
                 <div class="services-item">
                    <img src="../assets/icons/wechat.png" alt="">
                    <span>小程序</span>
                </div>
            </a-popover>
        </div>
        <a-back-top>
            <div class="fanhui">
                <img src="../assets/icons/top.png" alt="">
            </div>
        </a-back-top>
        <OnLine v-if="onlineVisible" @closeChat="closeChat"></OnLine>
    </div>
</template>
<script>
import OnLine from './onLine.vue'
export default {
    name: 'Services',
    components: {
        OnLine
    },
    data() {
        return {
            onlineVisible: false,
            servicesObj: {}
        }
    },
    mounted() {
        this.getSeverces();
    },
    methods: {
        async getSeverces() {
            const res = await this.$request.get('api/index/platform_config');
            if (res.code === 1) {
                this.servicesObj = res.data || {};
            }
        },
        closeChat() {
            this.onlineVisible = false;
        }
    }
}
</script>
<style lang="less" scoped>
.services{
    width: 64px;
    // height: 238px;
    background: linear-gradient( 357deg, #6FA2FF 0%, #4D85FF 53%, #87B4FF 100%);
    box-shadow: 0px 0px 6px 0px rgba(0,0,0,0.13);
    border-radius: 10px;
    position: fixed;
    right: 40px;
    top: 50%;
    .services-item{
        height: 64px;
        margin: 10px auto;
        border-bottom: 0.5px solid #F0F0F0;
        img{
            width: 30px;
            height: 30px;
            margin: 5px 0;
        }
        span{
            font-weight: 400;
            font-size: 12px;
            color: #FFFFFF;
            display: block;
        }
        &:last-child{
            border-bottom: none;
        }
        &:hover{
            cursor: pointer;
        }
    }
    /deep/ .ant-back-top{
        position: fixed;
        right: 60px;
        top: 66%;
    }
    .fanhui{
        width: 64px;
        height: 64px;
        background: #FFFFFF;
        box-shadow: 0px 0px 6px 0px rgba(0,0,0,0.13);
        border-radius: 6px;
        margin-top: 20px;
        img{
            width: 30px;
            height: 30px;
            margin-top: 17px;
        }
    }
}
.ant-popover-inner-content{
    .phoneitem{
        display: flex;
        // align-items: center;
        padding: 10px 17px;
        img{
            width: 30px;
            height: 30px;
            margin-right: 10px;
        }
        .lxfs{
            text-align: left;
            span{
                display: block;
            }
        }
    }
    .wechatWrap{
        img{
            width: 120px;
            height: 120px;
            margin: 20px auto;
        }
        p{
            font-weight: 400;
            font-size: 14px;
            color: #000000;
            text-align: center;
        }
    }
}
</style>